package com.example.demo.service;

import com.example.demo.entity.Articleinfo;
import com.example.demo.mapper.ArticleMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: demo
 * @author: JCM
 * @create: 2023-08-01 10:04
 * @description:
 **/
@Service
public class ArticleService {
    @Resource
    private ArticleMapper articleMapper;

    public int getArtCountByUid(Integer uid) {
        return articleMapper.getArticleCountById(uid);
    }
    public List<Articleinfo> getMyList(Integer uid) {
        return articleMapper.getMyList(uid);
    }

    public int delArt(Integer id,Integer uid) {
        return articleMapper.delArt(id,uid);
    }

    public Articleinfo getDetail(Integer id) {
        return articleMapper.getDetail(id);
    }

    public int incRCount(Integer id) {
        return articleMapper.incRCount(id);
    }

    public int addArt(Articleinfo articleinfo) {
        return articleMapper.addArt(articleinfo);
    }

    public int update(Articleinfo articleinfo) {
        return articleMapper.update(articleinfo);
    }

    public List<Articleinfo> getListByPage(Integer psize, Integer offsize) {
        return articleMapper.getListByPage(psize,offsize);
    }

    public int getCount() {
        return articleMapper.getCount();
    }
}
